<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;

use App\Services\PosApi\RefundConfirm;

class RefundConfirmJob implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    public $tries = 5;
    public $backoff = 10;

    protected $refund;


    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($refund)
    {
        $this->onConnection('redis-enhanced');
        $this->refund = $refund;
    }

    public function handle()
    {
        $rcService = new RefundConfirm();
        $rcService->handle($this->refund);
    }
}
